<template>
  <div class="list-wrapper">
    <div v-for="i in list" :key="i.id" class="list mt10">
      <div class="img">
        <van-image width="100px" height="85px" :src="i.picUrl" />
      </div>
      <div class="info">
        <div class="name">
          <span>{{ i.name }}</span>
          <span
            v-for="j in i.alias"
            :key="j.id"
            style="color: #999"
          >/{{ j }}</span>
        </div>
        <div class="musicSize">歌曲:{{ i.musicSize }}</div>
        <div class="albumSize">专辑：{{ i.albumSize }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapActions } from 'vuex'
export default {
  props: {
    type: {
      type: Number,
      default: 5001
    }
  },
  data() {
    return {
      list: []
    }
  },
  created() {
    this.getList({ cat: this.type }).then((res) => {
      if (res.data.code === 200) {
        this.list = res.data.artists
      }
    })
  },
  methods: {
    ...mapActions(['getList'])
  }
}
</script>

<style lang="scss" scoped>
.list-wrapper {
  width: 100%;
  padding-bottom: 10px;
  .list {
    width: 100%;
    height: 85px;
    display: flex;
    align-content: flex-start;
    border-bottom: 1px solid #eee;
    padding: 0 10px;
    .img {
      flex: 0 0 100px;
    }
    .info {
      padding: 0 10px;
      flex: 1;
      .name {
        height: 30px;
        line-height: 30px;
      }
      .musicSize {
        height: 25px;
        line-height: 25px;
        font-size: 14px;
      }
      .albumSize {
        height: 25px;
        line-height: 25px;
        font-size: 14px;
      }
    }
    &:last-child {
      border: none;
    }
  }
}
</style>
